package com.itbaizhan.test.exercise;

/**
 * 测试内部类的用法
 */
public class Outer2 {
    private int age = 10;
    public void show(){
        System.out.println("Outer2.show");
        System.out.println(age);
    }
   //非静态内部类必须存在外部类里面
    public class Inner {
        int age = 22;
        public  void show(){
            System.out.println("Inner.show");
            System.out.println(age);
            //访问外部类的属性\方法
            System.out.println(Outer2.this.age);
            Outer2.this.show();


        }
    }
}
